﻿<%sub style_plus%>

<a href="?Fmenu=style_plus&amp;s=a">已安装插件管理</a> | <a href="?Fmenu=style_plus&amp;s=b">安装插件</a> | <a href="?Fmenu=style_plus&amp;s=c">新建插件</a><br />
<hr />
<%if request.querystring("act")="re" then%>
<script language="javascript">
            location.href = "?Fmenu=style_plus"
          </script>
<%end if
Set PluginsXML = New PXML
if request.QueryString("s")="b" then%>
<form method="POST" action="?Fmenu=saveplusb">
  <table style="width:90%;" border="1" cellspacing="0" bordercolor="#000000" cellpadding="0">
    <tbody>
      <tr>
        <td style="width:20%;"> 名称 </td>
        <td style="width:15%;"> 作者 </td>
        <td style="width:15%;"> 版本号 </td>
        <td style="width:25%;"> 唯一标识符 </td>
        <td style="width:25%;"> 操作 </td>
      </tr>
      <%
SET Fso = CreateObject("Scripting.FileSystemObject")
Set X = Fso.GetFolder(Server.MapPath(plus_path))
For Each F in X.Subfolders
PluginsXML.XmlPath = plus_path&"/"&F.Name&"/Info.xml"
PluginsXML.Open
UnPlugName = PluginsXML.SelectXmlNodeText("Plugin/PluginInstall/name")
UnPlugWriter = PluginsXML.SelectXmlNodeText("Plugin/PluginInstall/writer")
UnPlugvern = PluginsXML.SelectXmlNodeText("Plugin/PluginInstall/beat")
UnPlugguid = PluginsXML.SelectXmlNodeText("Plugin/PluginInstall/Guidcode")
%>
      <tr>
        <td><%=UnPlugName%></td>
        <td><%=UnPlugWriter%></td>
        <td><%=UnPlugvern%></td>
        <td><%=UnPlugguid%></td>
        <td><a href="?Fmenu=addpul&url=<%=F.Name%>">安装插件</a>&nbsp;|&nbsp;编辑插件&nbsp;|&nbsp;关于 </td>
      </tr>
      <%next%>
    </tbody>
  </table>
  <input type="submit" value="提交" />
</form>
<%else
if request.QueryString("s")="c" then
%>
<form id="form1" name="DBform" method="post" action="?Fmenu=saveplusc">
  <table width="1000" border="0">
    <tr>
      <td width="80" align="left" valign="top">插件名称</td>
      <td align="left" valign="top"><input name="NewPlu_Name" type="text" id="NewPlu_Name2" size="50" /></td>
    </tr>
       <tr>
      <td width="80" align="left" valign="top">默认标题</td>
      <td align="left" valign="top"><input name="NewPlu_defaultTitle" type="text" id="NewPlu_Name2" size="50" /></td>
    </tr>
    <tr>
      <td width="80" align="left" valign="top">默认位置</td>
      <td align="left" valign="top"><select name="NewPlu_Type">
          <option value="0">侧边</option>
          <option value="1">内容</option>
          <option value="2">隐藏</option>
        </select></td>
    </tr>
       <tr>
      <td width="80" align="left" valign="top">文件夹名称</td>
      <td align="left" valign="top"><input name="NewPlu_Url" type="text" id="NewPlu_Name2" size="50" /></td>
    </tr>

    <tr>
      <td width="80" align="left" valign="top"><label>插件作者</label></td>
      <td align="left" valign="top"><input name="NewPlu_writer" type="text" size="50"/></td>
    </tr>
    <tr>
      <td width="80" align="left" valign="top"><label>插件版本</label></td>
      <td align="left" valign="top"><input name="NewPlu_beat" type="text" size="50"/></td>
    </tr>
    <tr>
      <td width="80" align="left" valign="top"><label>唯一标识符</label></td>
      <td align="left" valign="top"><input name="NewPlu_Guidcode" type="text" value="<%=EnGUIDCode%>" size="50" readonly="readonly"/></td>
    </tr>
    <tr>
      <td width="80" align="left" valign="top">选项面板</td>
      <td align="left" valign="top"><input name="NewPlu_checksPlane" type="checkbox"/></td>
    </tr>
</table><hr />
<table id="activeTable" width="500px"> 
<caption>数据库选项</caption>
    <tr><td width="50px">编号</td> 
        <td width="200px">标题</td> 
        <td width="200px">值</td> 
        <td width="50px">操作</td> 
    </tr> 
<table> 
<SCRIPT LANGUAGE="JavaScript"> 
var ii=0
function addrow() {　 
ii=ii+1
var row = activeTable.insertRow(activeTable.rows.length);　 
var col = row.insertCell(0);　 
var i = row.rowIndex;
col.innerHTML = ii;col = row.insertCell(1);　　
col.innerHTML = '<input name="name'+ii+'" size="20">';col = row.insertCell(2);　　 
col.innerHTML = '<input name="vaule'+ii+'" size="20">';col = row.insertCell(3);　　 
col.innerHTML = '<button onClick="delrow()">删除</button>';col = row.insertCell(4);
document.DBform.action='?Fmenu=saveplusc&num='+ii}　 
function delrow () {　 
var srcName = document.getElementsByTagName("button");　 
var rowIndex = 0;　 
for (i=0;i<srcName.length;i++){　 
if(srcName[i]==event.srcElement)　 
rowIndex=i;　 
}　 
activeTable.deleteRow(rowIndex + 1);　 
document.DBform.action='?Fmenu=saveplusc&num='+ii}　 
</script>
<input type="button" name="btn" value="添加" onClick="addrow()">
</table><hr />
  插件编辑:
  <textarea name="NewPlu_ycode" id="NewPlu_ycode" cols="100" rows="10"></textarea>
  选项面板编辑:
  <textarea name="NewPlu_scode" id="NewPlu_scode" cols="100" rows="10"></textarea>
  <link rel="stylesheet" href="../kindeditor/themes/default/default.css" />
  <link rel="stylesheet" href="../kindeditor/plugins/code/prettify.css" />
  <script charset="utf-8" src="../kindeditor/kindeditor.js"></script> 
  <script charset="utf-8" src="../kindeditor/lang/zh_CN.js"></script> 
  <script charset="utf-8" src="../kindeditor/plugins/code/prettify.js"></script> 
  <script>
		KindEditor.ready(function(K) {
			var editor1 = K.create('textarea[name="NewPlu_ycode"]', {
				cssPath : '../kindeditor/plugins/code/prettify.css',
				uploadJson : 'pages/editor/upload_json.asp',
				fileManagerJson : 'pages/editor/file_manager_json.asp',
				allowFileManager : true,
			});
			prettyPrint();
		});
		KindEditor.ready(function(K) {
			var editor2 = K.create('textarea[name="NewPlu_scode"]', {
				cssPath : '../kindeditor/plugins/code/prettify.css',
				uploadJson : 'pages/editor/upload_json.asp',
				fileManagerJson : 'pages/editor/file_manager_json.asp',
				allowFileManager : true,
			});
			prettyPrint();
		});
	</script>
  <input type="submit" value="提交" />
</form>
<%else%>
<form method="POST" action="?Fmenu=saveplusa">
  <table style="width:860;" border="1" cellspacing="0" bordercolor="#000000" cellpadding="0">
    <tbody>
      <tr>
        <td style="width:140px;"> 顺序 </td>
        <td style="width:140px;"> 标题 </td>
        <td style="width:55px;"> 类型 </td>
        <td style="width:55px;"> 版本 </td>
        <td style="width:295px;"> 唯一标识符 </td>
        <td style="width:190px;"> 操作 </td>
      </tr>
      <%
For i=0 to PlusDBRootcount
plus_feed_where=PlusDBRoot.childNodes.item(i).childNodes.item(0).text
plus_feed_name =PlusDBRoot.childNodes.item(i).childNodes.item(1).text
plus_feed_url  =PlusDBRoot.childNodes.item(i).childNodes.item(2).text
plus_feed_id   =PlusDBRoot.childNodes.item(i).attributes.item(0).value
PluginsXML.XmlPath = plus_path&"/"&plus_feed_url&"/Info.xml"
PluginsXML.Open
UnPlugName = PluginsXML.SelectXmlNodeText("Plugin/PluginInstall/name")
UnPlugWriter = PluginsXML.SelectXmlNodeText("Plugin/PluginInstall/writer")
UnPlugvern = PluginsXML.SelectXmlNodeText("Plugin/PluginInstall/beat")
UnPlugguid = PluginsXML.SelectXmlNodeText("Plugin/PluginInstall/Guidcode")

%>
      <tr>
        <td><input type="text" name="<%=i%>_1" value="<%=plus_feed_id%>"></td>
        <td><input type="text" name="<%=i%>_2" value="<%=plus_feed_name%>"></td>
        <td><select name="<%=i%>_3">
            <option value="0" <%if plus_feed_where="0" then echo"selected"%>>侧边</option>
            <option value="1" <%if plus_feed_where="1" then echo"selected"%>>内容</option>
            <option value="2" <%if plus_feed_where="2" then echo"selected"%>>隐藏</option>
          </select></td>
        <td><%=UnPlugvern%></td>
        <td><%=UnPlugguid%></td>
        <td><a href="?Fmenu=unsteppul&delid=<%=i%>">卸载插件</a>&nbsp;|&nbsp;编辑插件&nbsp;|&nbsp;关于 </td>
      </tr>
      <%next%>
    </tbody>
  </table>
  <input type="submit" value="提交" />
</form>
<%
end if
end if
PluginsXML.CloseXml
end sub%>
